<?php
    class StringUtils
    {
        protected function __construct()
        {
        }

        public static function Slugify($text)
        {
            // replace all non letters or digits by -
            $text = preg_replace('/\W+/', '-', $text);

            // trim and lowercase
            $text = strtolower(trim($text, '-'));

            return $text;
        }
    }
?>